package com.warrior.entity;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * Created by Shawn on 2017/3/15.
 */
@Entity
@Table(name = "activity", schema = "warrior")
public class ActivityEntity {
    private String id;//记录活动id
    private Integer activitySequence;//活动排序
    private Integer activityType;//记录活动类型,0表示积分排名赛,1表示系列赛
    private String activityName;//记录活动名称
    private String activityLocation;//记录活动场地
    private Timestamp activityTime;//记录活动开始的时间
    private Timestamp applyDeadLine;//记录报名截止日期
    private Integer teamUpperLimit;//队伍报名上限
    private Timestamp createdAt;//记录该条记录的创建时间
    private Timestamp updateAt;//记录该条记录的更新时间
    private String createdBy;//记录该条记录的创建者
    private String updateBy;//记录该条记录由何人更新
    private String parentId;//记录父级活动id
    private Integer isRecommend; //是否被推荐,0表示未推荐活动,1表示推荐活动
    private Integer isNew; //查看是否为新活动,0表示否,1表示是
    private Integer activityStatus;//查看活动状态 1表示报名中,2表示备战中,3表示活动结束,默认0
    private String activityIntroduction;//活动介绍
    private String picPath; //赛事介绍配图

    @Id
    @Column(name = "id")
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Basic
    @Column(name = "activity_sequence")
    public Integer getActivitySequence() {
        return activitySequence;
    }

    public void setActivitySequence(Integer activitySequence) {
        this.activitySequence = activitySequence;
    }

    @Basic
    @Column(name = "activity_type")
    public Integer getActivityType() {
        return activityType;
    }

    public void setActivityType(Integer activityType) {
        this.activityType = activityType;
    }

    @Basic
    @Column(name = "activity_name")
    public String getActivityName() {
        return activityName;
    }

    public void setActivityName(String activityName) {
        this.activityName = activityName;
    }

    @Basic
    @Column(name = "activity_location")
    public String getActivityLocation() {
        return activityLocation;
    }

    public void setActivityLocation(String activityLocation) {
        this.activityLocation = activityLocation;
    }

    @Basic
    @Column(name = "activity_time")
    public Timestamp getActivityTime() {
        return activityTime;
    }

    public void setActivityTime(Timestamp activityTime) {
        this.activityTime = activityTime;
    }

    @Basic
    @Column(name = "apply_dead_line")
    public Timestamp getApplyDeadLine() {
        return applyDeadLine;
    }

    public void setApplyDeadLine(Timestamp applyDeadLine) {
        this.applyDeadLine = applyDeadLine;
    }

    @Basic
    @Column(name = "team_upper_limit")
    public Integer getTeamUpperLimit() {
        return teamUpperLimit;
    }

    public void setTeamUpperLimit(Integer teamUpperLimit) {
        this.teamUpperLimit = teamUpperLimit;
    }

    @Basic
    @Column(name = "created_at")
    public Timestamp getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Timestamp createdAt) {
        this.createdAt = createdAt;
    }

    @Basic
    @Column(name = "update_at")
    public Timestamp getUpdateAt() {
        return updateAt;
    }

    public void setUpdateAt(Timestamp updateAt) {
        this.updateAt = updateAt;
    }

    @Basic
    @Column(name = "created_by")
    public String getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy;
    }

    @Basic
    @Column(name = "update_by")
    public String getUpdateBy() {
        return updateBy;
    }

    public void setUpdateBy(String updateBy) {
        this.updateBy = updateBy;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ActivityEntity that = (ActivityEntity) o;

        if (id != null ? !id.equals(that.id) : that.id != null) return false;
        if (activitySequence != null ? !activitySequence.equals(that.activitySequence) : that.activitySequence != null)
            return false;
        if (activityType != null ? !activityType.equals(that.activityType) : that.activityType != null) return false;
        if (activityName != null ? !activityName.equals(that.activityName) : that.activityName != null) return false;
        if (activityLocation != null ? !activityLocation.equals(that.activityLocation) : that.activityLocation != null)
            return false;
        if (activityTime != null ? !activityTime.equals(that.activityTime) : that.activityTime != null) return false;
        if (applyDeadLine != null ? !applyDeadLine.equals(that.applyDeadLine) : that.applyDeadLine != null)
            return false;
        if (teamUpperLimit != null ? !teamUpperLimit.equals(that.teamUpperLimit) : that.teamUpperLimit != null)
            return false;
        if (createdAt != null ? !createdAt.equals(that.createdAt) : that.createdAt != null) return false;
        if (updateAt != null ? !updateAt.equals(that.updateAt) : that.updateAt != null) return false;
        if (createdBy != null ? !createdBy.equals(that.createdBy) : that.createdBy != null) return false;
        if (updateBy != null ? !updateBy.equals(that.updateBy) : that.updateBy != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (activitySequence != null ? activitySequence.hashCode() : 0);
        result = 31 * result + (activityType != null ? activityType.hashCode() : 0);
        result = 31 * result + (activityName != null ? activityName.hashCode() : 0);
        result = 31 * result + (activityLocation != null ? activityLocation.hashCode() : 0);
        result = 31 * result + (activityTime != null ? activityTime.hashCode() : 0);
        result = 31 * result + (applyDeadLine != null ? applyDeadLine.hashCode() : 0);
        result = 31 * result + (teamUpperLimit != null ? teamUpperLimit.hashCode() : 0);
        result = 31 * result + (createdAt != null ? createdAt.hashCode() : 0);
        result = 31 * result + (updateAt != null ? updateAt.hashCode() : 0);
        result = 31 * result + (createdBy != null ? createdBy.hashCode() : 0);
        result = 31 * result + (updateBy != null ? updateBy.hashCode() : 0);
        return result;
    }

    @Basic
    @Column(name = "parent_id")
    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    @Basic
    @Column(name = "is_recommend")
    public Integer getIsRecommend() {
        return isRecommend;
    }

    public void setIsRecommend(Integer isRecommend) {
        this.isRecommend = isRecommend;
    }

    @Basic
    @Column(name = "is_new")
    public Integer getIsNew() {
        return isNew;
    }

    public void setIsNew(Integer isNew) {
        this.isNew = isNew;
    }

    @Basic
    @Column(name = "activity_status")
    public Integer getActivityStatus() {
        return activityStatus;
    }

    public void setActivityStatus(Integer activityStatus) {
        this.activityStatus = activityStatus;
    }

    @Basic
    @Column(name = "activity_introduction")
    public String getActivityIntroduction() {
        return activityIntroduction;
    }

    public void setActivityIntroduction(String activityIntroduction) {
        this.activityIntroduction = activityIntroduction;
    }

    @Basic
    @Column(name = "pic_path")
    public String getPicPath() {
        return picPath;
    }

    public void setPicPath(String picPath) {
        this.picPath = picPath;
    }
}
